package cn.zn.job;

import cn.hutool.core.date.DateUtil;
import cn.zn.quartz.dto.JobDto;
import cn.zn.quartz.job.AbstractQuartzJob;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class ExampleJob extends AbstractQuartzJob {

    private static final Logger logger = LoggerFactory.getLogger(ExampleJob.class);

    @Override
    protected void doExecute(JobExecutionContext context, JobDto job) throws Exception {
        Date date = new Date();
        logger.info("now time: {}", DateUtil.format(date, "yyyy-MM-dd HH:mm:ss"));
    }

}
